{% load static %}
<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    {#通过{% block title %}base{% endblock %};设置了一个动态的页面title块;#}
    <title>{% block title %}base{% endblock %}</title>
    {#<title>{{ title }}</title>#}

    <!-- Bootstrap -->
    <link href="{% static 'css/bootstrap.min.css' %}" rel="stylesheet">
    <script src="{% static 'js/jquery-3.3.1.min.js' %}"></script>
    <script src="{% static 'js/bootstrap.min.js' %}"></script>
    {#通过{% block css %}{% endblock %},设置了一个动态的css加载块;#}
    {% block css %}

    {% endblock %}
</head>

<body>
    <nav class="navbar navbar-default">
        <div class="container-fluid">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#my-nav"
                    aria-expanded="false">
                    <span class="sr-only">切换导航条</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="#">myBlog</a>
            </div>

            <div class="collapse navbar-collapse" id="my-nav">
                <ul class="nav navbar-nav">
                    <li class="active"><a href="/ajaxTest/toIndex">主页</a></li>
                </ul>
                <ul class="nav navbar-nav navbar-right">
                    {% if request.session.is_login %}
                    <li><a href="#">当前在线：{{ request.session.user_name }}</a></li>
                    <li><a href="/ajaxTest/logout">登出</a></li>
                    {% else %}
                    <li><a href="/ajaxTest/login">登录</a></li>
                    <li><a href="/ajaxTest/register">注册</a></li>
                    {% endif %}
                </ul>
            </div>
        </div>
    </nav>
    {#通过{% block content %}{% endblock %},为具体页面的主体内容留下接口;#}
    {% block content %}

    {% endblock %}
</body>

</html>